for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class extends BaseSchema {
protected tableName = 'users'
public async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('name', 255).notNullable()
table.string('email', 255).notNullable().unique()
table.timestamp('email_verified_at', { useTz: true }).nullable()
table.string('password', 180).notNullable()
table.tinyint('is_merchant', 3).defaultTo(0)
table.string('remember_me_token').nullable()
/**
* Uses timestampz for PostgreSQL and DATETIME2 for MSSQL
*/
table.timestamp('created_at', { useTz: true }).notNullable()
table.timestamp('updated_at', { useTz: true }).notNullable()
})
}
public async down() {
this.schema.dropTable(this.tableName)